package game;

import java.util.Objects;

public class Equipment {
    String name; // 物品名称
    String type; // 物品类型（武器或护甲）
    int attackBonus; // 攻击力加成
    int defenseBonus; // 防御力加成
    int price; // 价格

    Equipment(String name, String type, int attackBonus, int defenseBonus, int price) {
        this.name = name;
        this.type = type;
        this.attackBonus = attackBonus;
        this.defenseBonus = defenseBonus;
        this.price = price;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        Equipment other = (Equipment) obj;
        return Objects.equals(name, other.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }
}
